/**
 * Copyright (c) 2006-2012 Las Venturas Playground, LVP Mineground
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package mineground.entities;

/**
 * In order to abstract general LVM logic away from the native player implementation, provide basic
 * functionality in a Player base implementation class. All methods implemented in this class should
 * be thread-safe, as they can be used without any communication with the game layer at all.
 * 
 * A list of variables which have to be controlled by the NativePlayer implementation provided for
 * the server system is as follows. Please keep in mind that modifications to these variables has
 * to be resembled in the values as well.
 * 
 * mName           Username of the player.
 * mDisplayName    Display name of the player.
 */
public class PlayerBaseImpl {
    protected String mName;
    protected String mDisplayName;
    
    /**
     * Retrieve the name of this player.
     * 
     * @return String The username of the player.
     */
    public String getName() {
        synchronized (mName) {
            return mName;
        }
    }
    
    /**
     * Retrieve the display name used by this player. This may be different from their nickname, and
     * should be used for the chat box.
     * 
     * @return String The display name of the player, used in chat.
     */
    public String getDisplayName() {
        synchronized (mDisplayName) {
            return mDisplayName;
        }
    }
}
